<?php 
if(!defined('BASEPATH')) {
	exit('No direct script access allowed');
}

/*
 *用户登录
 *@author 王春林
 */
class home extends CI_Controller {
	function __construct() {
		parent::__construct();
	}
	
	function index($type) {
		$this->load->view("login");
		$this->load->view("footers/footer02");
	}
	/*
	 *用户登录
	 */
	function user_login() {
		$username =! empty ( $_POST['username'] ) ?$_POST['username'] : '' ;
		$password =! empty ( $_POST['password']) ? $_POST['password']: '' ;
		$result = $this->login_model->user_login($username,md5($password));
		log_message("info",'$result=>'.$result);
		if(!empty($result)) {
			$this->load->view("cjzy");
			$this->session->set_userdata($result);
			$this->load->view("/footers/footer02");
		}else {
			$data['errorInfo'] = "用户不存在";
			$this->load->view("login",$data);
		}
	}
}
?>